import numpy as np
a1 = np.arange(12).reshape((3,4))
# 统计数组中不是nan的个数
print(np.count_nonzero(a1))
print('*'*100)
# 统计数组中是nan的值
print(np.isnan(a1))
print('*'*100)
# nan与任何值计算都为nan
print(np.sum(a1))
print(np.sum(a1,axis=0))
print(np.sum(a1,axis=1))
print("*"*100)
# 计算均值
print(a1.mean())
print(a1.mean(axis=0))
# 计算中值，中值：将数进行排序，取中间那个数
print(np.median(a1,axis=0))
# 计算最大值，最小值
print(np.max(a1))
print(np.min(a1,axis=0))
# 计算极值：最大值与最小值的差
print(np.ptp(a1))
# 计算标椎差
print(np.std(a1))
